<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('标题')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-name" data-rule="required" class="form-control"  type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-info" class="control-label col-xs-12 col-sm-2">{:__('推送地址')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-info" data-rule="required" class="form-control"  type="text" value="{$row.url}?id={$row.urlid}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-info" class="control-label col-xs-12 col-sm-2">{:__('推送内容')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-info" data-rule="required" class="form-control"  type="text" value="{$row.info|htmlentities}">
        </div>
    </div>
     <div class="form-group">
        <label for="content" class="control-label col-xs-12 col-sm-2">{:__('是非推送')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[type]', ['1'=>__('未推送'), '2'=>__('已推送')], $row['type'])}
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <input type="hidden" id="id"  value="{$row.id}">
            <button type="button" id="tuisax" class="btn btn-success btn-embossed">{:__('确认推送')}</button>
        </div>
    </div>
</form>
<script src="/assets/libs/jquery/dist/jquery.min.js?v=1619157096"></script>
<script src="/assets/libs/fastadmin-layer/dist/layer.js?v=1619157592"></script>
<script>
 $("#tuisax").click(function(){
    var id=$('#id').val()
    if(!id){
        layer.msg('id不对');
        return false;
    }
    var params={'id':id};
    $.ajax({
            url:"user/xxts/tuisax", // 目标资源
            cache: false, //true 如果当前请求有缓存的话，直接使用缓存。如果该属性设置为 false，则每次都会向服务器请求
            async: true, //默认是true，即为异步方式
            data: params,
            dataType: "json", // 服务器响应的数据类型
            type: "POST", // 请求方式
            success: function (data) {
                console.log(data)
                if(data.code==1){
                    parent.Fast.events.onAjaxSuccess(data.msg)
                    Fast.api.close()
                    parent.$("a.btn-refresh").trigger("click");
                }else{
                    layer.msg(data.msg);
                }
            }
        });
 });

</script>